﻿using Newtonsoft.Json;
using ThresholdAssistant.Enums;
using System;
using System.Text.Json.Serialization;

namespace ThresholdAssistant.DataContract.Models
{
    /// <summary>
    /// 机器人心跳模型
    /// </summary>
    [Serializable]
    public class RobotHeartInfoModel
    {
        /// <summary>
        /// 心跳状态
        /// 10：离线
        /// 20：在线
        /// </summary>
        [JsonProperty("status"), JsonPropertyName("status")]
        public RobotHeartbeatStatusEnum Status { get; set; }

        /// <summary>
        /// 登出错误代码
        /// </summary>
        [JsonProperty("offline_code"), JsonPropertyName("offline_code")]
        public string OfflineCode { get; set; }

        /// <summary>
        /// 登出错误原因
        /// </summary>
        [JsonProperty("offline_reason"), JsonPropertyName("offline_reason")]
        public string OfflineReason { get; set; }

        /// <summary>
        /// 首次心跳上报时间
        /// </summary>
        [JsonProperty("heartbeat_online_time"), JsonPropertyName("heartbeat_online_time")]
        public DateTime HeartbeatOnlineTime { get; set; }

        /// <summary>
        /// 心跳离线时间
        /// 主动离线和心跳过期
        /// </summary>
        [JsonProperty("heartbeat_offline_time"), JsonPropertyName("heartbeat_offline_time")]
        public DateTime HeartbeatOfflineTime { get; set; }
    }
}